<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>首页</title>
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/scss.css">
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/reset.css">
	<script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
	<script type="text/javascript" src="<?php echo IMG_PATH ?>bdkd/js/swiper-3.4.2.jquery.min.js"></script>
	<script type="text/javascript" src="<?php echo IMG_PATH ?>bdkd/js/swiper-3.4.2.min.js"></script>
	<script src="<?php echo IMG_PATH ?>bdkd/js/jquery-1.11.1.min.js"></script>
	<link rel="stylesheet" type="text/css" href="<?php echo IMG_PATH ?>bdkd/css/swiper.css">
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/swiper.min.css">
</head>
<body>
	<div id="waikuang">
		<div class="daohangtiao">
			<div class="dht">
				<div class="gongsi">
					<div class="gongsi-one">
						<p class="bug">公司</p>
						<img class="xiala" src="<?php echo IMG_PATH ?>bdkd/img/xiala-32@2x.png" alt="">
						<div class="kuaidigongsi" style="display:none">
							<ul id="ul">
                                <?php

                                foreach ($express as $val){
                                    ?>
                                    <li value="<?php echo $val->code;?>"><?php echo $val->name;?></php></li>
                                    <?php
                                }
                                ?>
							</ul>
						</div>
					</div>
				</div>
                <input type="hidden" name="code" id="code" value=""/>
				<input name="ex_order" id="ex_order" type="text" placeholder="请输入单号查询快递"/>
				<a style="text-decoration:none;" class="fangdajing" onclick="getgoods()">
					<img class="fdj" src="<?php echo IMG_PATH ?>bdkd/img/fdj@2x.png" alt="">
				</a>
			</div>
		</div>
		<div class="swiper-container">
		  <div class="swiper-wrapper">
		    <div class="swiper-slide"><img src="<?php echo IMG_PATH ?>bdkd/img/banner1@2x.png" alt=""></div>
		    <div class="swiper-slide"><img src="<?php echo IMG_PATH ?>bdkd/img/banner2@2x.png" alt=""></div>
		    <div class="swiper-slide"><img src="<?php echo IMG_PATH ?>bdkd/img/banner3@2x.png" alt=""></div>
		  </div>
	
		   <div class="swiper-pagination"></div>
		   
		</div>
		<div class="lunbo-down">
			<a style="text-decoration:none;" class="kdzq gongtongdian" href="<?php echo SITE_PATH ?>work/bexpress/index">
				<img src="<?php echo IMG_PATH ?>bdkd/img/ji-@2x.png" alt="">
				<p>邮寄快递</p>
			</a>
			<a style="text-decoration:none;" class="czlc gongtongdian" href="<?php echo SITE_PATH ?>work/bexpress/qu">
				<img src="<?php echo IMG_PATH ?>bdkd/img/qu@2x.png" alt="">
				<p>代取快递</p>
			</a>
			<a style="text-decoration:none;" class="wlty gongtongdian" href="<?php echo SITE_PATH ?>work/bexpress/wu">
				<img src="<?php echo IMG_PATH ?>bdkd/img/tuo@2x.png" alt="">
				<p>物流托运</p>
			</a>
		</div>
		<div class="ssgz-top">
			<a style="text-decoration:none;" class="xinjiade" href="<?php echo SITE_PATH ?>work/bexpress/price">
				<img src="<?php echo IMG_PATH ?>bdkd/img/价格@2x.png" alt="">
				<p>价格查询</p>
			</a>
			<a style="text-decoration:none;" class="xinjiade" href="<?php echo SITE_PATH ?>work/bexpress/time">
				<img src="<?php echo IMG_PATH ?>bdkd/img/时效@2x.png" alt="">
				<p>时效查询</p>
			</a>
			<a style="text-decoration:none;" class="xinjiade" href="<?php echo SITE_PATH ?>work/bpost/jx">
				<img src="<?php echo IMG_PATH ?>bdkd/img/禁忌@2x.png" alt="">
				<p>禁寄物品</p>
			</a>
			<a style="text-decoration:none;" class="xinjiade" href="<?php echo SITE_PATH ?>work/bpost/customer">
				<img src="<?php echo IMG_PATH ?>bdkd/img/tell@2x.png" alt="">
				<p>客服电话</p>
			</a>
		</div>
		<div class="ssgz">
			<span></span><span>实时跟踪</span>
		</div>
		<div class="kuaidi">
            <?php
            if(empty($list)){

                ?>
                <div  class="kuaidi-beijing">
                    <img src="<?php echo IMG_PATH ?>bdkd/img/wei@2x.png" alt="">
                    <p>亲爱的小主,开始您的第一单邮寄吧！</p>
                </div>
                <?php
            }else{
                foreach ($list as $val){

                    ?>
                    <input type="hidden" id="id" value="<?php echo $val['id'];?>">
                    <div class="line-wrapper">
                        <div class="line-scroll-wrapper">
                            <div class="line-normal-wrapper" onclick='getInfo("<?php echo $val['express_name'];?>","<?php echo $val['ex_order'];?>")'>
                                <div class="line-normal-left-wrapper">
                                    <div class="line-normal-avatar-wrapper">

                                        <?php
                                        if($val['express_name']=='zhongtong'){
                                            ?>
                                            <img src="<?php echo IMG_PATH ?>bdkd/img/zhongtong.png" alt="">
                                            <?php
                                        }
                                        if($val['express_name']=='yousuwuliu'){
                                            ?>
                                            <img src="<?php echo IMG_PATH ?>bdkd/img/yousu.png" alt="">
                                            <?php
                                        }
                                        if($val['express_name']=='yunda'){
                                            ?>
                                            <img src="<?php echo IMG_PATH ?>bdkd/img/yunda.png" alt="">
                                            <?php
                                        }
                                        if($val['express_name']=='yuantong'){
                                            ?>
                                            <img src="<?php echo IMG_PATH ?>bdkd/img/yuantong.png" alt="">
                                            <?php
                                        }
                                        if($val['express_name']=='shunfeng'){
                                            ?>
                                            <img src="<?php echo IMG_PATH ?>bdkd/img/shunfeng.png" alt="">
                                            <?php
                                        }
                                        if($val['express_name']=='debangwuliu'){
                                            ?>
                                            <img src="<?php echo IMG_PATH ?>bdkd/img/debang.png" alt="">
                                            <?php
                                        }
                                        if($val['express_name']=='huitongkuaidi'){
                                            ?>
                                            <img src="<?php echo IMG_PATH ?>bdkd/img/baishi.png" alt="">
                                            <?php
                                        }
                                        if($val['express_name']=='shentong'){
                                            ?>
                                            <img src="<?php echo IMG_PATH ?>bdkd/img/shentong.png" alt="">
                                            <?php
                                        }
                                        ?>
<!--                                        <img src="--><?php //echo IMG_PATH ?><!--bdkd/img/shunfeng@2x.png" />-->

                                    </div>
                                    <div class="line-normal-info-wrapper">
                                        <div class="line-normal-user-name"><span>
                                                <?php
                                                if($val['express_name']=='zhongtong'){
                                                    ?>
                                                    中通快递
                                                    <?php
                                                }
                                                if($val['express_name']=='yousuwuliu'){
                                                    ?>
                                                    优速物流
                                                    <?php
                                                }
                                                if($val['express_name']=='yunda'){
                                                    ?>
                                                    韵达快递
                                                    <?php
                                                }
                                                if($val['express_name']=='yuantong'){
                                                    ?>
                                                    圆通快递
                                                    <?php
                                                }
                                                if($val['express_name']=='shunfeng'){
                                                    ?>
                                                    顺丰快递
                                                    <?php
                                                }
                                                if($val['express_name']=='debangwuliu'){
                                                    ?>
                                                    德邦物流
                                                    <?php
                                                }
                                                if($val['express_name']=='huitongkuaidi'){
                                                    ?>
                                                    百世汇通
                                                    <?php
                                                }
                                                if($val['express_name']=='shentong'){
                                                    ?>
                                                    申通快递
                                                    <?php
                                                }
                                                ?>

                                            </span><span><?php echo date("Y-m-d H:i",strtotime($val['time'])); ?></span></div>
                                        <div class="line-normal-msg">状态：<marquee><?php echo $val['state'];?></marquee></div>
                                        <div class="line-normal-time">单号：<?php echo $val['ex_order'];?></div>
                                    </div>
                                </div>
                                <div class="line-normal-icon-wrapper"></div>
                            </div>
                            <div class="line-btn-delete" onclick="del()">删除</div>
                        </div>
                    </div>
                    <?php
                }
            }
            ?>
        </div>
	</div>
	<div class="kong"></div>

	<div class="flooter">
		<ul>
			
			<li>
				<a href="<?php echo SITE_PATH?>work/bpost/success">
					<img src="<?php echo IMG_PATH ?>bdkd/img/fz-two@2x.png"/>
					<p  class="color">首页</p>
				</a>
			</li>
			
			
			<li>
				<a href="<?php echo SITE_PATH?>work/borders/untreated">
					<img src="<?php echo IMG_PATH ?>bdkd/img/dingdan-z@2x.png" />
					<p>订单</p>
				</a>
			</li>
			
			
			<li>
				<a href="<?php echo SITE_PATH?>work/buser/userInfo">
					<img src="<?php echo IMG_PATH ?>bdkd/img/rt-one@2x.png" />
					<p>我的</p>
				</a>	
			</li>
			
		</ul>
	</div>
	<script src="<?php echo IMG_PATH ?>bdkd/js/swiper.min.js"></script>
	<script src="<?php echo IMG_PATH ?>bdkd/js/swiper.jquery.js"></script>
	<script src="<?php echo IMG_PATH ?>bdkd/js/shouye.js"></script>
    <script>
//        $('.kuaidi .line-wrapper').each(function(index,item){
//            $(item).click(function(){
//
//
//                window.location.href="<?php //echo SITE_PATH?>//work/bpost/goodsInfo";
//            })
//        });



//        $("#put").click(function(){
//
//        });

        function getInfo(type,postid) {
            //alert(6666);//return false;

            window.location.href="<?php echo SITE_PATH?>work/bpost/goodsInfo?code="+type+"&ex_order="+postid;
        }

        function getgoods() {
            var code =$(" input[ name='code' ] ").val();
            var ex_order =$(" input[ name='ex_order' ] ").val();

            if(code==""){
                alert("请先选择要查询的快递公司再填写快递单号!");
                return false;
            }
            if(ex_order==""){
                alert("请输入快递单号!");
                return false;
            }
            window.location.href="<?php echo SITE_PATH?>work/bpost/goodsInfo?code="+code+"&ex_order="+ex_order;
        }

        $("#ul li").click(function(){

            var code = $(this).attr('value');
            var name = $(this).text();
            $("#code").val(code);
            $("#ex_order").val(name);
        });

        $("#ex_order").focus(function(){
            $(this).val("");
        });



        function del() {
            var id=$("#id").val();
            //alert(id);
           // console.log(id);//return false;
            $.ajax({
                url:"<?php echo SITE_PATH ?>work/bpost/delState",
                type:"post",
                data:{
                    'id': id
                },
                success: function(data){
                    console.log(data);
                    if(data.result==1){
                        alert('删除成功!');
                    }else {
                        alert(data.msg);
                    }
                },
                error: function(){
                    alert('删除失败0!');
                }
//                async:"false";
            })

        }
    </script>
</body>
</html>